Namespace.Use("Base.Utility", function(ns) {
    var MergeDictionary = Polymorphic.Create(
        [Object, Object, Boolean],
        function(target, src, is_recursive) {
            if (is_recursive) {
                var ret = target;

                for (var key in src) {
                    if (!(key in target)) {
                        ret[key] = src[key];
                    } else {
                        if (typeof(src[key]) == "object" && typeof(ret[key]) == "object") {
                            ret[key] = Merge(ret[key], src[key], true);
                        } else {
                            //  Override.
                            ret[key] = src[key];
                        }
                    }
                }

                return ret;
            } else {
                var ret = target;

                //  Merge source dictionary to target dictionary.
                for (var key in src) {
                    ret[key] = src[key];
                }

                return ret;
            }
        }
    );

    //  Export public APIs.
    Namespace.Export(ns, "MergeDictionary", MergeDictionary);
});